#ifndef __CLIENT_H__
#define __CLIENT_H__

#include "InetAddress.h"
#include <fstream>
#include <iostream>
#include <sys/socket.h>
#include <arpa/inet.h>
#
using std::ifstream;
using std::cout; 
using std::endl;
using std::string;
using std::pair;

class Client{
public:
    Client(){}
    ~Client(){}
    pair<string, string> readConf();
    void Socket();
    void TcpConnect(InetAddress &addr);
    void start(){
        // 打开文件读取 IP 和端口
        InetAddress addr(readConf().first, readConf().second);
        Socket();
        TcpConnect(addr);
    }
    int getfd(){
       return _fd; 
    }
private:
    int _fd;
};

#endif // !__CLIENT_H__
